package com.ggb.smartstudy.service.Impl;

import com.ggb.smartstudy.entity.CourseCategory;
import com.ggb.smartstudy.mapper.CourseCategoryMapper;
import com.ggb.smartstudy.service.CourseCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author gefangjie
 */
@Service
public class CourseCategoryServiceImpl implements CourseCategoryService {

    private final CourseCategoryMapper courseCategoryMapper;

    @Autowired
    public CourseCategoryServiceImpl(CourseCategoryMapper courseCategoryMapper) {
        this.courseCategoryMapper = courseCategoryMapper;
    }

    @Override
    public CourseCategory getCourseCategoryById(Integer id) {
        return courseCategoryMapper.getCourseCategoryById(id);
    }

    @Override
    public List<CourseCategory> getAllCourseCategories() {
        return courseCategoryMapper.getAllCourseCategories();
    }

    @Override
    public void insertCourseCategory(CourseCategory courseCategory) {
        courseCategoryMapper.insertCourseCategory(courseCategory);
    }

    @Override
    public void updateCourseCategory(CourseCategory courseCategory) {
        courseCategoryMapper.updateCourseCategory(courseCategory);
    }

    @Override
    public void deleteCourseCategory(Integer id) {
        courseCategoryMapper.deleteCourseCategory(id);
    }
}
